import threading
from time import sleep

from loguru import logger


def work():
    for _ in range(10):
        logger.info('工作中...')
        sleep(0.2)


if __name__ == '__main__':
    # 创建子线程并指定执行的任务
    work_thread = threading.Thread(target=work)
    # 启动子线程执行任务
    work_thread.start()

    # 延时1秒
    sleep(1)
    logger.info('主线程执行完毕！')
